package thread1;

public class sleepdemo {

    public static void main(String[] args) throws InterruptedException {

       Thread t1 = new Thread(()->{
            System.out.println(Thread.currentThread().getName()+"start");
           try {
               Thread.sleep(1000);
           } catch (InterruptedException e) {
               throw new RuntimeException(e);
           }
           System.out.println(Thread.currentThread().getName()+"end");
       },"t1");
       t1.start();
       Thread.sleep(100);
        Thread t2 = new Thread(()->{
            System.out.println(Thread.currentThread().getName());
        },"t2");
       t2.start();

    }
}
